import json
from Fan import Fan

resp = {'code': 0, 'data': {'has_next': 1, 'list': [
    {'badge': '独家', 'badge_info': {'bg_color': '#00C0FF', 'bg_color_night': '#0B91BE', 'text': '独家'},
     'badge_type': 1, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/107eb93eff876dee16da4bf270b31c3e250e49d6.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/8a5212a46e7e828d4fbce9a216048fcb89482f53.png',
                  'ep_id': 316301}, 'index_show': '2020年1月10日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss31779?theme=movie', 'media_id': 28226644,
     'order': '4732.1万次播放', 'order_type': '2', 'score': '9.9', 'season_id': 31779, 'season_status': 13,
     'season_type': 2, 'subTitle': '紫罗兰永恒花园系列', 'title': '紫罗兰永恒花园外传：永远与自动手记人偶',
     'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/9b0e9b6f7570a0a4af05cac8eed7191205b6ba64.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/ed4ca7982299ff25c0ed90cb1ade6869b53e3111.jpg',
                  'ep_id': 254507}, 'index_show': '2004年11月19日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss25992?theme=movie', 'media_id': 3335618,
     'order': '4705.6万次播放', 'order_type': '2', 'score': '9.7', 'season_id': 25992, 'season_status': 13,
     'season_type': 2, 'subTitle': '我准备好了！', 'title': '海绵宝宝历险记', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/c6858628a8844d513767966b6a2ba4f09e367c5b.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/bangumi/3019bd4947c0c4e003e6696e9769c9c11e570ec3.jpg',
                  'ep_id': 398460}, 'index_show': '2021年2月12日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss37663?theme=movie', 'media_id': 28233342,
     'order': '4501.2万次播放', 'order_type': '2', 'score': '8.9', 'season_id': 37663, 'season_status': 13,
     'season_type': 2, 'subTitle': '东方朋克风新国漫', 'title': '新神榜：哪吒重生', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/23b1fabb35bbc20b91207edd6a66a8719f8cd297.jpg',
     'first_ep': {'cover': 'http://i2.hdslb.com/bfs/archive/c46fdb79e6f51e1012e42b6580846fc8f6aff991.jpg',
                  'ep_id': 118317}, 'index_show': '2017年9月8日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss12116?theme=movie', 'media_id': 12116, 'order': '4361.2万次播放',
     'order_type': '2', 'score': '9.6', 'season_id': 12116, 'season_status': 13, 'season_type': 2,
     'subTitle': '京阿尼绝美画风！', 'title': '声之形', 'title_icon': ''},
    {'badge': '', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': ''}, 'badge_type': 0,
     'cover': 'http://i0.hdslb.com/bfs/bangumi/image/4fed6a1e2e9aae0f171c904c36c23384586e8d90.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/c92f2c99ebf15e780e9f82b5a349cc63364ad252.jpg',
                  'ep_id': 86701}, 'index_show': '全1话', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss2688?theme=movie', 'media_id': 2688, 'order': '4345.9万次播放',
     'order_type': '2', 'score': '9.6', 'season_id': 2688, 'season_status': 2, 'season_type': 1,
     'subTitle': '一生的距离', 'title': '秒速五厘米', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/5dbd732c94e009a41730a92e02276432e6f4e9df.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/0d0fa253695cf124cc480a902da06d5cb1ac3404.png',
                  'ep_id': 479840}, 'index_show': '2022年2月1日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss41437?theme=movie', 'media_id': 28237146,
     'order': '4251.5万次播放', 'order_type': '2', 'score': '9.8', 'season_id': 41437, 'season_status': 13,
     'season_type': 2, 'subTitle': '羊狼组队打篮球', 'title': '喜羊羊与灰太狼之筐出未来', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/5d2547fccd75717eab7426cb94b021ec71473b76.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/28e336eca56fe4b2589a53c6faab7801056b0197.png',
                  'ep_id': 316163}, 'index_show': '2013年7月31日上映', 'is_finish': 0,
     'link': 'https://www.bilibili.com/bangumi/play/ss32436?theme=movie', 'media_id': 28227720,
     'order': '4212.7万次播放', 'order_type': '2', 'score': '9.7', 'season_id': 32436, 'season_status': 13,
     'season_type': 2, 'subTitle': '巨型机甲对抗巨兽', 'title': '环太平洋', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/486279f1e8d4d93866747d68341fd3ce0c614af6.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/639d77829614727470878e7c7037595dc67b24b6.jpg',
                  'ep_id': 260611}, 'index_show': '1972年3月15日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss26416?theme=movie', 'media_id': 8550222,
     'order': '4155.4万次播放', 'order_type': '2', 'score': '9.9', 'season_id': 26416, 'season_status': 13,
     'season_type': 2, 'subTitle': '黑手党家族奋斗史', 'title': '教父', 'title_icon': ''},
    {'badge': '独家', 'badge_info': {'bg_color': '#00C0FF', 'bg_color_night': '#0B91BE', 'text': '独家'},
     'badge_type': 1, 'cover': 'http://i0.hdslb.com/bfs/bangumi/8cb95a71ddd461bcd31cbb75b6c1449570fd24ff.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/367b159d6eeba7a176a288067981ae0f18d13745.jpg',
                  'ep_id': 264969}, 'index_show': '2019年1月11日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss26703?theme=movie', 'media_id': 19011368,
     'order': '4125.9万次播放', 'order_type': '2', 'score': '9.6', 'season_id': 26703, 'season_status': 13,
     'season_type': 2, 'subTitle': '圣杯战争，开幕！', 'title': '命运之夜——天之杯：恶兆之花', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'https://i0.hdslb.com/bfs/bangumi/image/3a450129562bdeba90bc676789b7177f62946d09.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/1f0bb3d27d58c5c75ec3df9021dad42463992b67.jpg',
                  'ep_id': 752156}, 'index_show': '2022年8月6日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss45003?theme=movie', 'media_id': 28368476,
     'order': '4056.2万次播放', 'order_type': '2', 'score': '8.5', 'season_id': 45003, 'season_status': 13,
     'season_type': 2, 'subTitle': '红发歌姬乌塔登场', 'title': '航海王：红发歌姬', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/d6759b1c538cf8d23fabcb8ca36be787b8346ef4.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/3980fb3c59594ef3980da2a58569dc4e3636932f.jpg',
                  'ep_id': 702596}, 'index_show': '2022年5月13日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss43771?theme=movie', 'media_id': 28339924,
     'order': '3984.5万次播放', 'order_type': '2', 'score': '9.6', 'season_id': 43771, 'season_status': 13,
     'season_type': 2, 'subTitle': '空想、浪漫与友情', 'title': '新·奥特曼', 'title_icon': ''},
    {'badge': '', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': ''}, 'badge_type': 0,
     'cover': 'http://i0.hdslb.com/bfs/bangumi/image/5b00c25e00b639194f51ead01c557c9709c3ea6a.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/bangumi/73244aec6c562d2644f9c32606c8624f47759cba.jpg',
                  'ep_id': 63669}, 'index_show': '全1话', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss2546?theme=movie', 'media_id': 2546, 'order': '3971.8万次播放',
     'order_type': '2', 'score': '9.7', 'season_id': 2546, 'season_status': 2, 'season_type': 1,
     'subTitle': '新海诚力作', 'title': '言叶之庭', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/27e8185f6bd501ea9b0be78539fe72cc83d6b341.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/33f79e1db8e5322865d0107dd3291f45c4bad647.jpg',
                  'ep_id': 287967}, 'index_show': '2019年8月16日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss27821?theme=movie', 'media_id': 28221062,
     'order': '3865.1万次播放', 'order_type': '2', 'score': '6.5', 'season_id': 27821, 'season_status': 13,
     'season_type': 2, 'subTitle': '电竞少年的荣耀之路', 'title': '全职高手之巅峰荣耀', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/1a8e6a7405d631b399098e46c267d028e618bc75.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/8f90a139c594716f61f35faecaf68a3d082694a8.jpg',
                  'ep_id': 284310}, 'index_show': '1994年9月23日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss28274?theme=movie', 'media_id': 28221956,
     'order': '3795.1万次播放', 'order_type': '2', 'score': '9.9', 'season_id': 28274, 'season_status': 13,
     'season_type': 2, 'subTitle': '影史最高分电影', 'title': '肖申克的救赎', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/99e62fe75cda9d99450df0460307a73d65cf1578.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/0d2759f87484162d4836b60331b512a07555a5b5.jpg',
                  'ep_id': 326711}, 'index_show': '2019年3月1日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss33615?theme=movie', 'media_id': 28229044, 'order': '3768万次播放',
     'order_type': '2', 'score': '9.8', 'season_id': 33615, 'season_status': 13, 'season_type': 2,
     'subTitle': '黑白配公路片', 'title': '绿皮书', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/3b8acd7a69aa3462297b0b1f206e7093e4961914.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/c0a5b53a438b5e3c2aea79d18ff1b5074823f042.jpg',
                  'ep_id': 285026}, 'index_show': '2020年8月2日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss28585?theme=movie', 'media_id': 28222680,
     'order': '3747.1万次播放', 'order_type': '2', 'score': '9.9', 'season_id': 28585, 'season_status': 13,
     'season_type': 2, 'subTitle': '不要温和地走进良夜', 'title': '星际穿越', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/98d9134e936aca8c018c46f8e5da96bc6254cf1d.jpg',
     'first_ep': {'cover': 'http://i2.hdslb.com/bfs/archive/a0d2509d6310d7882b2aab92a4e6d8a46e3dff44.jpg',
                  'ep_id': 191020}, 'index_show': '2011年1月26日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss12445?theme=movie', 'media_id': 58172, 'order': '3652.9万次播放',
     'order_type': '2', 'score': '9.5', 'season_id': 12445, 'season_status': 13, 'season_type': 2,
     'subTitle': '还是那个同福客栈', 'title': '武林外传', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/ebecdba383a04699aa337180fe028d705a932ac5.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/53db8cddafdc361f2deab8aa03f8f95d8ee485a8.jpg',
                  'ep_id': 281206}, 'index_show': '2003年1月24日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss28296?theme=movie', 'media_id': 28222004,
     'order': '3616.5万次播放', 'order_type': '2', 'score': '9.8', 'season_id': 28296, 'season_status': 13,
     'season_type': 2, 'subTitle': '伏地魔卷土重来', 'title': '哈利·波特与密室', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'https://i0.hdslb.com/bfs/bangumi/image/612de4bca2e3db2863d5dd479aaa6352c5eedbb4.png',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/archive/762bab0f6696b666a3c0b476814f605938d12857.jpg',
                  'ep_id': 741421}, 'index_show': '2023年1月22日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss44496?theme=movie', 'media_id': 28480923, 'order': '3606万次播放',
     'order_type': '2', 'score': '9.2', 'season_id': 44496, 'season_status': 13, 'season_type': 2,
     'subTitle': '引爆泪腺的治愈之旅', 'title': '深海', 'title_icon': ''},
    {'badge': '会员专享', 'badge_info': {'bg_color': '#FB7299', 'bg_color_night': '#BB5B76', 'text': '会员专享'},
     'badge_type': 0, 'cover': 'http://i0.hdslb.com/bfs/bangumi/image/6560f6dd72f2f544820c69badf6be8a521797319.jpg',
     'first_ep': {'cover': 'http://i0.hdslb.com/bfs/bangumi/833697195c3c3069258f6e627db78acce27affb5.png',
                  'ep_id': 313864}, 'index_show': '2015年12月1日上映', 'is_finish': 1,
     'link': 'https://www.bilibili.com/bangumi/play/ss32663?theme=movie', 'media_id': 28227978,
     'order': '3602.3万次播放', 'order_type': '2', 'score': '9.8', 'season_id': 32663, 'season_status': 13,
     'season_type': 2, 'subTitle': '一起去抓水母吧', 'title': '海绵宝宝', 'title_icon': ''}], 'num': 2, 'size': 20,
                            'total': 5460}, 'message': 'success'}

list = resp['data']['list']
page = {
    "ep_id": "",
    "media_id": "",
    "badge": "",  # 独家
    "badge_type": "1",
    "index_show": "",  # 全4话
    "is_finish": "",  # 完结
    "link": "",
    "order": "",  # 831.1万追番
    "order_type": "1",
    "score": "0",  # 评分
    "season_id": "",
    "season_status": "0",
    "season_type": "0",
    "subTitle": "",  # 子标题
    "title": ""  # 标题
}

for item in list:
    page['ep_id'] = item['first_ep']['ep_id']
    page['badge'] = item['badge']
    page['badge_type'] = item['badge_type']
    page['index_show'] = item['index_show']
    page['is_finish'] = item['is_finish']
    page['link'] = item['link']
    page['media_id'] = item['media_id']
    page['order'] = item['order']
    page['order_type'] = item['order_type']
    page['score'] = item['score']
    page['season_id'] = item['season_id']
    page['season_status'] = item['season_status']
    page['season_type'] = item['season_type']
    page['subTitle'] = item['subTitle']
    page['title'] = item['title']
    break

data = [
    [0, 0, 5], [0, 1, 1], [0, 2, 0], [0, 3, 0], [0, 4, 0], [0, 5, 0],
    [0, 6, 0], [0, 7, 0], [0, 8, 0], [0, 9, 0], [0, 10, 0], [0, 11, 2],
    [0, 12, 4], [0, 13, 1], [0, 14, 1], [0, 15, 3], [0, 16, 4], [0, 17, 6],
    [0, 18, 4], [0, 19, 4], [0, 20, 3], [0, 21, 3], [0, 22, 2], [0, 23, 5],
    [1, 0, 7], [1, 1, 0], [1, 2, 0], [1, 3, 0], [1, 4, 0], [1, 5, 0],
    [1, 6, 0], [1, 7, 0], [1, 8, 0], [1, 9, 0], [1, 10, 5], [1, 11, 2],
    [1, 12, 2], [1, 13, 6], [1, 14, 9], [1, 15, 11], [1, 16, 6], [1, 17, 7],
    [1, 18, 8], [1, 19, 12], [1, 20, 5], [1, 21, 5], [1, 22, 7], [1, 23, 2],
    [2, 0, 1], [2, 1, 1], [2, 2, 0], [2, 3, 0], [2, 4, 0], [2, 5, 0],
    [2, 6, 0], [2, 7, 0], [2, 8, 0], [2, 9, 0], [2, 10, 3], [2, 11, 2],
    [2, 12, 1], [2, 13, 9], [2, 14, 8], [2, 15, 10], [2, 16, 6], [2, 17, 5],
    [2, 18, 5], [2, 19, 5], [2, 20, 7], [2, 21, 4], [2, 22, 2], [2, 23, 4],
    [3, 0, 7], [3, 1, 3], [3, 2, 0], [3, 3, 0], [3, 4, 0], [3, 5, 0],
    [3, 6, 0], [3, 7, 0], [3, 8, 1], [3, 9, 0], [3, 10, 5], [3, 11, 4],
    [3, 12, 7], [3, 13, 14], [3, 14, 13], [3, 15, 12], [3, 16, 9], [3, 17, 5],
    [3, 18, 5], [3, 19, 10], [3, 20, 6], [3, 21, 4], [3, 22, 4], [3, 23, 1],
    [4, 0, 1], [4, 1, 3], [4, 2, 0], [4, 3, 0], [4, 4, 0], [4, 5, 1],
    [4, 6, 0], [4, 7, 0], [4, 8, 0], [4, 9, 2], [4, 10, 4], [4, 11, 4],
    [4, 12, 2], [4, 13, 4], [4, 14, 4], [4, 15, 14], [4, 16, 12], [4, 17, 1],
    [4, 18, 8], [4, 19, 5], [4, 20, 3], [4, 21, 7], [4, 22, 3], [4, 23, 0],
    [5, 0, 2], [5, 1, 1], [5, 2, 0], [5, 3, 3], [5, 4, 0], [5, 5, 0],
    [5, 6, 0], [5, 7, 0], [5, 8, 2], [5, 9, 0], [5, 10, 4], [5, 11, 1],
    [5, 12, 5], [5, 13, 10], [5, 14, 5], [5, 15, 7], [5, 16, 11], [5, 17, 6],
    [5, 18, 0], [5, 19, 5], [5, 20, 3], [5, 21, 4], [5, 22, 2], [5, 23, 0],
    [6, 0, 1], [6, 1, 0], [6, 2, 0], [6, 3, 0], [6, 4, 0], [6, 5, 0],
    [6, 6, 0], [6, 7, 0], [6, 8, 0], [6, 9, 0], [6, 10, 1], [6, 11, 0],
    [6, 12, 2], [6, 13, 1], [6, 14, 3], [6, 15, 4], [6, 16, 0], [6, 17, 0],
    [6, 18, 0], [6, 19, 0], [6, 20, 1], [6, 21, 2], [6, 22, 2], [6, 23, 6]
]
print(len(data))
range_color = ["#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf",
               "#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"]
